package com.zhx.ad.constant;

import com.github.shyiko.mysql.binlog.event.EventType;

/**
 * @author ：zhanghaixuan
 * @date ：Created in 2019-05-11 17:46
 * @description：用途:
 * @modified By：zhanghaixuan
 * @version: 1.0
 */
public enum OpType {
    /**
     * 类型
     */
    ADD,
    UPDATE,
    DELETE,
    OTHER;

    public static OpType to(EventType eventType) {

        switch (eventType) {
            case EXT_WRITE_ROWS:
                return ADD;
            case EXT_UPDATE_ROWS:
                return UPDATE;
            case EXT_DELETE_ROWS:
                return DELETE;

            default:
                return OTHER;
        }
    }
}
